/**
 * Created by walkman on 2017/7/11.
 */
/**
 * Services that persists and retrieves data from  API
 *
 */
//
angular.module('WfbPlatformApp')
  .factory('dashboardService', ['$http', '$q', function ($http, $q) {

    return {

      getUserAssetInfo: function (paramData) {
        var deferred = $q.defer();
        $http({
          method: 'POST',
          url: 'user/user_detail',
          data: paramData
        }).then(function success(result) {

            if (result.data.retCode == '1') {
              // 请求成功
              deferred.resolve(result.data);
            }
            // else {
            //   deferred.reject("failed to fetch  data");
            // }
          },
          function error(error) {
            deferred.reject(error);//请求失败
          }
        );
        return deferred.promise;//返回承诺
      }
    };

  }]);


